Skip to content

provide startup time to ready log point and associated benchmark#22581

Open
tilladam wants to merge 1 commit into
rust-lang:masterfrom
tilladam:internal/startup-time-to-ready
Open

provide startup time to ready log point and associated benchmark#22581
tilladam wants to merge 1 commit into
rust-lang:masterfrom
tilladam:internal/startup-time-to-ready

Conversation

@tilladam

Copy link
Copy Markdown
Contributor

While profiling rust-analyzer startup and workspace initialization I found it useful to get the timing of completed cache priming, when the workspace is loaded and indexed. This patch provides that log point and a benchmark to track it over time.

Disclosure: Anthropic Claude 4.7 built the benchmark, a supposedly qualified human reviewed it and takes responsibility for it.

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jun 13, 2026
@tilladam tilladam force-pushed the internal/startup-time-to-ready branch from 7e73760 to b2b142a Compare June 13, 2026 13:28
@ChayimFriedman2

Copy link
Copy Markdown
Contributor

I'm sorry but I don't think this is worth the extra complexity when we already have a prime-caches subcommand.

@tilladam

Copy link
Copy Markdown
Contributor Author

Thanks for looking at this. The prime-caches subcommand is great for testing the raw database caching, but it bypasses the main_loop completely. It doesn't run the actual LSP server, the VFS progress sync, or the flycheck background tasks. I can be convinced that the benchmark doesn't add a ton of value, since regressions are somewhat more likely to come from the interaction of all those things, rather than the code path the benchmark covers, but I'd argue the log point still makes it quite a bit easier to get timing measurements in a significant spot when profiling the launch experience more holistically, for very modest added complexity.

@ChayimFriedman2

Copy link
Copy Markdown
Contributor

It still loads all files into the VFS and runs Cargo. We don't have much more than that.

But since you disagree, let's ask: @rust-lang/rust-analyzer does someone do want this?

@Veykril

Veykril commented Jun 19, 2026

Copy link
Copy Markdown
Member

Yea I don't think this is too useful either, having an fino log when done with workspace loading etc seems fine to me though, but anything other than that is unnecessary if you ask me

@tilladam

Copy link
Copy Markdown
Contributor Author

So you're saying keep the log point and nix the benchmark? I'm ok with that.

@Veykril

Veykril commented Jun 19, 2026

Copy link
Copy Markdown
Member

Yea but without the time tracking, just have a log for startup, and a log for whenever we load a workspace, the default logger has timestamps already after all

@tilladam tilladam force-pushed the internal/startup-time-to-ready branch from b2b142a to 928bc46 Compare June 19, 2026 11:29
Add a simple info log statement when cache priming finishes on startup.

Disclosure: Anthropic Claude 3.5 Flash assisted with this change.
@tilladam tilladam force-pushed the internal/startup-time-to-ready branch from 928bc46 to ac8291b Compare June 19, 2026 11:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants